<?php if(!defined('ROOT_PATH')) exit('Access Denied');?><dl class="Tabs">
<dt id="TagsTabs"><a href="#tabTaguserlist" class="select">用户列表</a> <a href="#tabTagList">管理员列表</a><a href="#tabTagAdd">添加管理员</a></dt>
<dd id="tabTaguserlist" style="display: block; ">
   	<p class="operate">操作: 
<a href="#" onclick="checkAll('list-user'); return false;">选择全部</a> , 
<a href="#" onclick="uncheckAll('list-user'); return false;">全部不选</a>&nbsp;&nbsp;&nbsp;
选择项: <a href="#" onclick="if(confirm('确定删除?')){metaDeleteb();} return false;">删除</a>
</p>
<table class="list-table" id="list-user">
<colgroup>
<col width="25">
<col width="200">
<col width="200">
<col width="205">
<col width="130">
</colgroup>
<thead>
<tr>
<th class="radius-topleft"> </th>
<th>ID</th>
<th>名字</th>
<th>头像</th>
<th class="radius-topright">登录时间</th>
</tr>
</thead>
<tbody>

                <?php if(is_array($userdata)) foreach($userdata AS $vlaue) { ?> 
                <tr  id="tag-<?php echo $vlaue["userId"];?>">
<td><input type="checkbox" value="<?php echo $vlaue["userId"];?>" name="mid[]"></td>
<td><?php echo $vlaue["userId"];?></td>
<td><?php echo $vlaue["userName"];?></td>
<td><img width="30" height="30" src="<?php echo $vlaue["userHead"];?>" /></td>
<td><?php echo $vlaue["userDate"];?></td>
</tr>
<?php } ?>

</tbody>
</table>
        
        <div class="nav">
<div class="nav-content">
<ul>
<?php if(is_array($page['all_pages'])) foreach($page['all_pages'] AS $vlaue) { ?>
<?php if($page['current_page'] == $vlaue) { ?>
<li class="current">
 <a onclick="ajaxLoad('/admin.php/Admin_Users/main/p/<?php echo $vlaue;?>');return false;" href="#"><?php echo $vlaue;?></a>
 </li>
<?php } else { ?>
<li>
<a onclick="ajaxLoad('/admin.php/Admin_Users/main/p/<?php echo $vlaue;?>');return false;" href="#"><?php echo $vlaue;?></a>
</li>
 <?php } ?> 
<?php } ?>


</ul>
</div>
</div>
</dd>
<dd id="tabTagList" style="display: none; ">
<p class="operate">操作: 
<a href="#" onclick="checkAll('list-tag'); return false;">选择全部</a> , 
<a href="#" onclick="uncheckAll('list-tag'); return false;">全部不选</a>&nbsp;&nbsp;&nbsp;
选择项: <a href="#" onclick="if(confirm('确定删除?')){metaDelete();} return false;">删除</a>
</p>
<table class="list-table" id="list-tag">
<colgroup>
<col width="25">
<col width="25">
<col width="175">
                <col width="200">
<col width="205">
<col width="130">
</colgroup>
<thead>
<tr>
<th class="radius-topleft"> </th>
<th>ID</th>
<th>名字</th>
                    <th>邮箱</th>
<th>最近登录时间</th>
<th class="radius-topright">最近登录IP</th>
</tr>
</thead>
<tbody>

                <?php if(is_array($admindata)) foreach($admindata AS $vlaue) { ?> 
                <tr  id="tag-<?php echo $vlaue["id"];?>">
<td><input type="checkbox" value="<?php echo $vlaue["id"];?>" name="aid[]"></td>
<td><?php echo $vlaue["id"];?></td>
<td><a href="#" onclick="ajaxLoad('/admin.php/Admin_Users/edit/id/<?php echo $vlaue["id"];?>');return false;"><?php echo $vlaue["name"];?></a></td>
                <td><?php echo $vlaue["email"];?></td>
<td><?php echo $vlaue["lasttime"];?></td>
<td><?php echo $vlaue["lastip"];?></td>
</tr>
<?php } ?>

</tbody>
</table>
        
        
</dd>
    <dd id="tabTagAdd" style="display: none; ">
    <form action="/admin.php/Admin_Users/Add" method="post" name="add_admin" id="add-admin">
<ul id="add-post-option">
<li>
<label for="add-user-name" class="add-post-label">用户名：</label>
                <input id="add-user-name" name="name" type="name" value="" class="add-post-text" autocomplete="off">
</li>
<li>
<label for="add-user-pw" class="add-post-label">密码：</label>
<input id="add-user-pw" name="password" type="password" value="" class="add-post-text" autocomplete="off">
</li>
<li>
<label for="add-user-email" class="add-post-label">邮箱：</label>
<input id="add-user-email" name="email" type="text" value="" class="add-post-text" autocomplete="off">
</li>
<li>
                <label for="add-user-group" class="add-post-label"></label>
<input type="hidden" name="uid" value="1" />
<input type="submit" id="add-admin-submit" name="add-admin-submit" value="添加管理员" />
</li>
</ul>
</form>
    </dd>
</dl>
<script>
Tabs(document.getElementById('TagsTabs'), 'select', 0);
$('#add-admin').ajaxForm({
beforeSubmit: function(){
$("#add-admin-submit").attr('disabled',true);
},
success: function(data){
if(data=='ok!') {
showMessage('添加成功！','tips');
$("#add-admin-submit").attr('disabled',false);
ajaxLoad('/admin.php/Admin_Users');
} else {
showMessage(data,'error');
}
}});
function metaDeleteb() {
$("#list-user input:checked").each(function(){
$.post(
'/admin.php/Admin_Users/Deluser',
{'mid':$(this).val()},
function(response){
if(!response){
showMessage('删除成功！','tips');
ajaxLoad('/admin.php/Admin_Users');
}
},
"json"
);
});

}
function metaDelete() {
$("#list-tag input:checked").each(function(){
$.post(
'/admin.php/Admin_Users/Del',
{'aid':$(this).val()},
function(response){
if(!response){
showMessage('删除成功！','tips');
ajaxLoad('/admin.php/Admin_Users');
}
},
"json"
);
});

}

</script>
